#ifndef DOWNLOADERWINDOW_H
#define DOWNLOADERWINDOW_H

#include <QMainWindow>
#include <QLabel>
#include <QTableWidget>
#include <QMenuBar>
#include <QHeaderView>
#include <QList>
#include <QMessageBox>

#include "config.h"
#include "newdownloaddialog.h"
#include "downloadservice.h"
#include "progressbardelegate.h"

class DownloaderWindow : public QMainWindow
{
    Q_OBJECT

    QTableWidget* myTable;
    DownloadService* downloadService;

    void addInfoToTable(DownloadInfo info);

    class MyTableWidgetItem : public QTableWidgetItem {
        public:
            bool operator <(const QTableWidgetItem& other) const
            {
                return data(0).value<StarRating>() < other.data(0).value<StarRating>();
            }
    };

public:
    explicit DownloaderWindow(QWidget *parent = 0);
    const DownloadInfo* const getByRow(int row) const;
    
signals:
    
public slots:
    void onClose();
    void startNewDownload();
    void progressChanged(const DownloadInfo* download, double progress);
    void showHelp();
};

#endif // DOWNLOADERWINDOW_H
